package com.example.myshoppingcar.bean;

import com.example.myshoppingcar.R;

import java.util.ArrayList;

public class GoodsInfo {
    public long rowid; // 行号
    public int sn; // 序号
    public String name; // 名称
    public String desc; // 描述
    public float price; // 价格
    public String thumb_path; // 小图的保存路径
    public String pic_path; // 大图的保存路径
    public int thumb; // 小图的资源编号
    public int pic; // 大图的资源编号

    public GoodsInfo() {
        rowid = 0L;
        sn = 0;
        name = "";
        desc = "";
        price = 0;
        thumb_path = "";
        pic_path = "";
        thumb = 0;
        pic = 0;
    }

    // 声明一个商品的名称数组
    private static String[] mNameArray = {
            "AWP|巨龙传说(崭新出厂)", "AK47|二西莫夫(久经沙场)", "M4A4|皇帝(久经沙场)", "P2000(StatTrak™)|黑曜石(略有磨损)",
            "格洛克18型|水灵(略有磨损)", "M9刺刀|渐变大理石(崭新出厂)","XM1014|斯康里娅(破损不堪)","USP|寻路者(久经沙场)"
    };
    // 声明一个商品的描述数组
    private static String[] mDescArray = {
            "AWP|巨龙传说(崭新出厂) 威力十分巨大的狙击步枪",
            "AK47|二西莫夫(久经沙场) 俄国名枪，一发一头",
            "M4A4|皇帝(久经沙场) 与HK416略有相似",
            "P2000(StatTrak™)|黑曜石(略有磨损) 经济的一把手枪",
            "格洛克18型|水灵(略有磨损) 可转化为全自动模式的手枪",
            "M9刺刀|渐变大理石(崭新出厂) 可安插在特殊枪支枪口下方",
            "XM1014|斯康里娅(破损不堪) 知名霰弹枪",
            "USP|寻路者(久经沙场) 警方配备较多的手枪"
    };
    // 声明一个商品的价格数组
    private static float[] mPriceArray = {34400, 139, 109, 16, 30, 2578, 2, 16};
    // 声明一个商品的小图数组
    private static int[] mThumbArray = {
            R.drawable.awp_s, R.drawable.ak47_s, R.drawable.m4a4_s,R.drawable.p2000_s,
            R.drawable.clock18_s, R.drawable.m9_s, R.drawable.xm1014_s,R.drawable.usp_s
    };
    // 声明一个商品的大图数组
    private static int[] mPicArray = {
            R.drawable.awp, R.drawable.ak47, R.drawable.m4a4,R.drawable.p2000,
            R.drawable.clock18, R.drawable.m9, R.drawable.xm1014,R.drawable.usp
    };

    // 获取默认的手机信息列表
    public static ArrayList<GoodsInfo> getDefaultList() {
        ArrayList<GoodsInfo> goodsList = new ArrayList<GoodsInfo>();
        for (int i = 0; i < mNameArray.length; i++) {
            GoodsInfo info = new GoodsInfo();
            info.name = mNameArray[i];
            info.desc = mDescArray[i];
            info.price = mPriceArray[i];
            info.thumb = mThumbArray[i];
            info.pic = mPicArray[i];
            goodsList.add(info);
        }
        return goodsList;
    }
}
